import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/system'
  },
  {
    path:'/login',
    name:'login',
    component:()=>import('../views/login/login.vue')
  },
  {
    path:'/register',
    name:'register',
    component:()=>import('../views/login/register.vue')
  },
  {
    path: '/system',
    name: 'System',
    component: () => import('../views/system/System.vue'),
    children: [
      {
        path: 'shopcar',
        component: () => import('../views/order/shopcar.vue'),
      },
      {
        path: 'admin',
        component: () => import('../views/admin/admin.vue'),
      },
      {
        path: 'addAdmin',
        component: () => import('../views/admin/addAdmin.vue'),
      },
      {
        path: 'superAdmin',
        component: () => import('../views/admin/superAdmin.vue'),
      },
      {
        path: 'picture',
        component: () => import('../views/admin/picture.vue'),
      },
      {
        path:'productlist',
        component: () => import( '../views/product/productlist.vue'),
      },
      {
        path:'productadd',
        component: () => import( '../views/product/productadd.vue'),
      },
      {
        path:"updateproduct",
        
        component:()=>import("../views/product/updateproduct.vue")
      },
      {
        path:"goods",
        
        component:()=>import("../views/product/goods.vue")
      },

    ]
  }
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router
